home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Games of Daze
/
Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso
/
x2ftp
/
msdos
/
progsrc
/
v3dt090
/
sin.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1994-09-19
|
670b
|
45 lines
#include <math.h>
#include "sin.h"
int sinus[361];
int cosinus[361];
int zDSin(int deg)
{
//deg %= 360;
if (deg < 0)
deg += 360;
return(sinus[deg]);
}
int zRSin(double rad)
{
return(zDSin((int) (rad * 180 / PI)));
}
int zDCos(int deg)
{
//deg %= 360;
if (deg < 0)
deg += 360;
return(cosinus[deg]);
}
int zRCos(double rad)
{
return(zDCos((int) (rad * 180 / PI)));
}
void initSinCos()
{
int count;
for (count = 0; count <= 360; count++)
{
sinus[count] = (int) (sin((float) count * PI / 180) * 65535);
cosinus[count] = (int) (cos((float) count * PI / 180) * 65535);
}
}